from eurasia import httpd, core

def handler(httpfile):
    httpfile.start_response('301 Moved Permanently', [('Location', 'http://www.baidu.com')])
    httpfile.write('hello')
    httpfile.close()

httpserver = httpd.Server('127.0.0.1:8080', handler)
httpserver.serve_forever()